{include file=member.header.html}
{$build_upload}
<style>
h2.title a.fold {position: absolute; top: 4px; right: 8px; width: 13px; height: 13px; overflow: hidden; display: block;}
.span_close {background: url({res file=images/member/close.gif});}
.span_open {background: url({res file=images/member/open.gif});}
.title {line-height: 24px; height: 24px; position: relative; background: #f5f5f5; font-size: 12px; color: #3e3e3e; padding-left: 20px; word-spacing: 3px; cursor: pointer;}

.btn { background:transparent url({res file=images/member/btn.gif}) repeat scroll 0 -590px; color:#3E3E3E; display:block; float:left; height: 24px; line-height:20px; margin: 0 3px; text-align:center; text-decoration:none; width:78px;}
.f_l{ float:left; }
.sub_btn {background:transparent url({res file=images/member/btn.gif}) no-repeat scroll 0 -253px; border:0 none; color:#3F3D3E; cursor:pointer; font-weight:bold; height:32px; width:120px; }
.gray{color: #B9B9B9; line-height: 22px; margin-left: 10px; }
.select select { color: #3D3D3D; padding: 2px; }
.table_text td { height : 30px; vertical-align:middle; }
</style>
<script type="text/javascript">
//<!CDATA[

function add_uploadedfile(file_data)
{
    $('label.right').show();
}
function uploadSuccess(file, serverData) {
    try {
        eval('serverData = '+serverData);
        var errorMsg = '';
        var progress = new FileProgress(file,  this.customSettings);
        if (serverData.done) {
            serverData.retval.file_name = file.name;
            add_uploadedfile(serverData.retval);
            progress.setStatus(lang.finish);
            progress.setComplete();
            progress.toggleCancel(false);
        } else {
            //addImage(SITE_URL + "/includes/libraries/javascript/swfupload/images/error.gif");
            progress.setStatus(lang.error);
            progress.toggleCancel(false);
            if(typeof(serverData.msg) == 'object'){
                $.each(serverData.msg, function(i, val){
                    errorMsg += lang.get(val.msg) + '[' + val.obj + ']\n';
                });
            } else {
                errorMsg += lang.get(serverData.msg);
            }
            if(errorMsg != ''){
                swfupload_error(errorMsg);
            }
        }


    } catch (ex) {
        this.debug(ex);
    }
}

function swfupload_error(str)
{
    $('#warning').append('<label class="error">' + str + '</label>');
    $('#warning').show();
}
$(function(){
        gcategoryInit("gcategory");
});
//]]>
</script>
<div class="content">
	<div class="totline"></div>
	<div class="botline"></div>
	{include file=member.menu.html}
	<div id="right"> {include file=member.curlocal.html}
		{include file=member.submenu.html}
		<div class="wrap">
			<div class="public">
				<form method="post" enctype="multipart/form-data" id="goods_form">
					<h2 class="title"> {$lang.import_taobao_csv}{if $step eq 2}
						<label class="error right">OK!{/if}</label>
						<a title="close" class="fold {if $step eq 2}span_open{else}span_close{/if}"></a> </h2>
					<ul{if $step eq 2} style="display:none"{/if}>
					<table class="table_text word_spacing5" style="margin-top:15px">
						<tr>
							<td valign="top"><p>{$lang.select_file}: </p></td>
							<td><input type="file" name="csv" id="csv" />
								<span class="gray">{$lang.note_for_taobao_file}</span></td>
						</tr>
						<tr>
							<td valign="top">{$lang.gcategory}:
								</th>
							<td><div class="select" id="gcategory">
									<input type="hidden" name="cate_id" value="{$goods.cate_id}" class="mls_id" />
									<input type="hidden" name="cate_name" value="{$goods.cate_name|escape}" class="mls_names" />
									<select>
										<option>{$lang.select_pls}</option>
										
                    {html_options options=$mgcategories}
                  
									</select>
									<span class="gray">{$lang.select_leaf_category}</span> </div></td>
						</tr>
						<tr>
							<td>{$lang.sgcategory}:
								</th>
							<td><div class="f_l select">
									<select name="sgcate_id[]" class="sgcategory">
										<option value="0">{$lang.select_pls}</option>
										
                  {html_options options=$sgcategories}
                
									</select>
								</div>
								<a class="btn" id="add_sgcategory" href="javascript:;">{$lang.add}</a> <span class="gray">{$lang.note_for_sgcategory}</span></td>
						</tr>
						<tr>
							<td valign="top">{$lang.charset}:
								</th>
							<td><p>
									<label> </label>
									<label>unicode</label>
								</p></td>
						</tr>
						<tr>
							<td valign="top">{$lang.file_format}:
								</th>
							<td>{$lang.file_format_limit}</td>
						</tr>
						<tr>
							<td valign="top"><p>{$lang.import_guide}: </p></td>
							<td><span class="gray" style="display:block;">{$lang.import_guide_content}</span></td>
						</tr>
					</table>
					<div class="send_out">
						<input class="sub_btn" type="submit" value="{$lang.import}" />
					</div>
					</ul>
					<h2 class="title"> {$lang.upload_taobao_image}
						<label style="display:none" class="error right">OK!</label>
						<a title="close" class="fold {if $step eq 2}span_close{else}span_open{/if}"></a> </h2>
					<ul{if $step eq 1} style="display:none"{/if}>
					<table class="word_spacing5">
						<tr>
							<td><span class="gray">{$lang.upload_taobao_image_note}</span></td>
						</tr>
						<tr id="trUploadContainer">
							<td height="40" valign="top"><div id="divSwfuploadContainer" style="width:740px;">
									<div id="divButtonContainer"> <span id="spanButtonPlaceholder"></span> </div>
									<div id="divFileProgressContainer"></div>
								</div>
								<div id="warning"></div></td>
						</tr>
					</table>
					</ul>
					</td>
					</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
	<div class="clear"></div>
</div>
{include file=footer.html}